import 'package:flutter/material.dart';
import 'package:ichinesereader/utils/colors.dart';

class AppTheme {
  static final colors = AppColors();

  const AppTheme._();

  static final ThemeData dartTheme = ThemeData(
    colorScheme: ColorScheme.dark(),
    floatingActionButtonTheme: FloatingActionButtonThemeData(
      foregroundColor: Color(0xFF111111),
      backgroundColor: Color(0xff777777),
    ),
    scaffoldBackgroundColor: Color(0xff0a0e21),
    fontFamily: 'Noto Sans SC',
    textTheme: TextTheme(
      bodyLarge: TextStyle(
        color: Color(0xff000000),
      ),
      bodyMedium: TextStyle(
        color: Color(0xff666666),
      ),
      labelLarge: TextStyle(),
      bodySmall: TextStyle(
        color: Color(0xffeeeeee),
        fontSize: 14,
        letterSpacing: 1,
      ),
      displayLarge: TextStyle(
        color: Color(0xffeeeeee),
        fontSize: 24,
        letterSpacing: 1,
        fontWeight: FontWeight.w500,
      ),
      displayMedium: TextStyle(
        color: Color(0xff444444),
        fontSize: 27,
        letterSpacing: 2,
      ),
      displaySmall: TextStyle(
        color: Color(0xffcccccc),
        fontSize: 20,
        letterSpacing: 1,
      ),
      headlineMedium: TextStyle(
        color: Color(0xffcccccc),
        fontSize: 21,
        letterSpacing: 1.0,
      ),
      headlineSmall: TextStyle(
        color: Color(0xffcccccc),
        fontSize: 21,
        letterSpacing: 1,
      ),
      titleLarge: TextStyle(
        color: Color(0xffcccccc),
        fontSize: 16,
        letterSpacing: 0,
      ),
      labelSmall: TextStyle(
        color: Colors.white,
        letterSpacing: 1.0,
        fontStyle: FontStyle.italic,
        fontSize: 16.0,
      ),
      titleMedium: TextStyle(
        color: Color(0xffcccccc),
        fontSize: 19,
        letterSpacing: 1,
      ),
      titleSmall: TextStyle(
        color: Color(0xffcccccc),
        fontSize: 17,
        letterSpacing: 2,
      ),
    ),
    primaryColor: Color(0xff555555),
    primaryColorLight: Color(0xffaaaaaa),
    primaryColorDark: Color(0xffdddddd),
    dividerTheme: DividerThemeData(color: Color(0xffcccccc)),
    listTileTheme: ListTileThemeData(),
    drawerTheme: DrawerThemeData(
      backgroundColor: Color(0xff111111),
    ),
    appBarTheme: AppBarTheme(
      backgroundColor: Color(0xff444444),
      toolbarTextStyle: TextStyle(
        fontSize: 16,
      ),
      titleTextStyle: TextStyle(
        fontSize: 28,
        //fontFamily: 'Montserrat',
        color: Color(0xffffffff),
      ),
    ),
    iconTheme: IconThemeData(color: Color(0xFFcccccc), size: 30),
    cardTheme: CardTheme(color: Color(0xff333333)),
    elevatedButtonTheme: ElevatedButtonThemeData(
      style: ButtonStyle(
        textStyle: MaterialStateProperty.all(
          const TextStyle(
            fontSize: 20,
            letterSpacing: 1.0,
          ),
        ),
        // minimumSize: MaterialStateProperty.all<Size>(Size(245, 50),),
        backgroundColor: MaterialStateProperty.all<Color>(
          Color(0xff555555),
        ),
        foregroundColor: MaterialStateProperty.all<Color>(
          Color(0xffd8ffff),
        ),
      ),
    ),
  ).copyWith(
    pageTransitionsTheme: PageTransitionsTheme(
      builders: <TargetPlatform, PageTransitionsBuilder>{
        TargetPlatform.android: OpenUpwardsPageTransitionsBuilder(),
        TargetPlatform.linux: OpenUpwardsPageTransitionsBuilder(),
        TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
      },
    ),
  );

  static final ThemeData lightTheme = ThemeData(
    floatingActionButtonTheme: FloatingActionButtonThemeData(
      foregroundColor: Color(0xFFd8ffff),
      backgroundColor: Color(0xff95e6ff),
    ),
    scaffoldBackgroundColor: Color(0xFFfefefe),
    brightness: Brightness.light,
    primaryColor: Color(0xff60BBB4),
    primaryColorDark: Color(0xff2D7DB8),
    secondaryHeaderColor: Color(0xffECA759),
    primaryColorLight: Color(0xffd8ffff),

    //primaryColorDark: Color(0xff0085cc),
    primarySwatch: Colors.cyan,
    drawerTheme: DrawerThemeData(
      backgroundColor: Color(0xff22c6c8),
    ),
    dividerTheme: DividerThemeData(color: Color(0xffd8ffff)),
    listTileTheme: ListTileThemeData(),
    //fontFamily: 'Montserrat',
    fontFamily: 'Noto Sans SC',
    snackBarTheme: SnackBarThemeData(
      contentTextStyle: TextStyle(fontFamily: 'Montserrat'),
      backgroundColor: Colors.white,
      disabledActionTextColor: Color(0xffcccccc),
    ),
    appBarTheme: AppBarTheme(
      color: Color(0xff23c6c8),
      toolbarTextStyle: TextStyle(
        color: Color(0xffd8ffff),
        fontSize: 28,
      ),
      titleTextStyle: TextStyle(
        color: Color(0xffd8ffff),
        fontSize: 28,
      ),
    ),
    iconTheme: IconThemeData(color: Color(0xff0085cc), size: 30),
    cardTheme: CardTheme(
      color: Color(0xffefefef),
    ),
    textTheme: TextTheme(
      bodyLarge: TextStyle(),
      bodyMedium: TextStyle(),
      labelLarge: TextStyle(),
      bodySmall: TextStyle(
        color: Color(0xff000000),
        fontSize: 14,
        letterSpacing: 1,
      ),
      displayLarge: TextStyle(
        color: Color(0xff00599b),
        fontSize: 23,
        letterSpacing: 1,
      ),
      displayMedium: TextStyle(
        color: Color(0xffd8ffff),
        fontSize: 21,
        letterSpacing: 1,
      ),
      displaySmall: TextStyle(
        color: Colors.blueGrey,
        fontSize: 20,
        letterSpacing: 1,
      ),
      headlineMedium: TextStyle(
        color: Color(0xffff00599b),
        fontSize: 21,
        letterSpacing: 1.0,
        backgroundColor: (Color(0xffd8ffff)),
      ),
      headlineSmall: TextStyle(
        color: Color(0xffff00543c),
        fontSize: 21,
        letterSpacing: 1,
        backgroundColor: (Color(0xffe3ffc7)),
      ),
      titleLarge: TextStyle(
        color: Color(0xff0085cb),
        fontSize: 16,
        letterSpacing: 0,
      ),
      labelSmall: TextStyle(
          color: Colors.black,
          letterSpacing: 1.0,
          fontStyle: FontStyle.italic,
          fontSize: 16.0,
          backgroundColor: Color(0xffffffd7)),
      titleMedium: TextStyle(
        color: Color(0xff00599b),
        fontSize: 19,
        letterSpacing: 1,
      ),
      titleSmall: TextStyle(
        color: Color(0xff00599b),
        fontSize: 17,
        letterSpacing: 1,
      ),
    ),
    elevatedButtonTheme: ElevatedButtonThemeData(
      style: ButtonStyle(
        textStyle: MaterialStateProperty.all(
          const TextStyle(
            fontSize: 20,
            letterSpacing: 1.0,
          ),
        ),
        // minimumSize: MaterialStateProperty.all<Size>(Size(245, 50),),
        backgroundColor: MaterialStateProperty.all<Color>(
          Color(0xff0085cb),
        ),
        foregroundColor: MaterialStateProperty.all<Color>(
          Color(0xffd8ffff),
        ),
      ),
    ),
  ).copyWith(
    pageTransitionsTheme: PageTransitionsTheme(
      builders: <TargetPlatform, PageTransitionsBuilder>{
        TargetPlatform.android: OpenUpwardsPageTransitionsBuilder(),
        TargetPlatform.linux: OpenUpwardsPageTransitionsBuilder(),
        TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
      },
    ),
  );
}
